/**
 * Word 风格的样式增强
 *
 *    版本功能：
 *       1. 给所有加了 .form-grid-word-theme 类名的元素加边框
 *       2. 去掉 .form-grid-word-theme 里面输入框的边框，使其视觉上铺满父级
 *       3. 设置 radio 在  .form-grid-word-theme 中的边距
 *       4. 给所有加了 .form-sub-table-word-theme 的子表设置特定的样式
 *       5. 当校验失败后 .form-grid-word-theme 下的边框会变为红色，并带有发光式阴影
 *       6. 给所有加了 .form-grid-word-theme.inner-grid 类名的元素加特定的内部边框
 *
 * @author sunjianlei
 * @version 5.0
 */

/* 
    table式风格的表单样式
    .el- 开头的都是 element ui 的类名
 */

/* 设置栅格布局的边框，下边距 -1px 可以让边框重合 */
.form-grid-word-theme {
    border: 1px solid #000;
    margin-bottom: -1px !important;
}

/* 设置内部栅格布局的边框 */
.form-grid-word-theme.inner-grid {
    border: 0;
    border-top: 1px solid #000;
}

.form-grid-word-theme.inner-grid:first-child {
    border-top: 0;
}

/* 设置每列的右边框 */
.form-grid-word-theme > .el-col {
    border-right: 1px solid #000;
}

/* 设置最后一列没有右边框 */
.form-grid-word-theme > .el-col:last-child {
    border-right: none;
}

/* 去掉form-item的下边距，让表单更紧凑 */
.form-grid-word-theme .el-form-item {
    margin-bottom: 0 !important;
}

.form-grid-word-theme .el-form-item {
    position: relative;
}

.form-grid-word-theme .el-form-item__error {
    z-index: 2;
    top: calc(100% + 4px);
    pointer-events: none;
}

.form-grid-word-theme .el-form-item:before {
    content: '';
    display: block;
    position: absolute;
    top: -1px;
    left: -1px;
    z-index: 3;
    width: calc(100% + 2px);
    height: calc(100% + 2px);
    border: 1px solid transparent;
    box-shadow: 0 0 6px 0 rgba(255, 0, 0, 0);
    transition: border-color 0.3s, box-shadow 0.3s;
    pointer-events: none;
}

/** 设置校验错误时边框为红色 */
.form-grid-word-theme .el-form-item.is-error:before {
    border-color: red;
    box-shadow: 0 0 6px 0 rgba(255, 0, 0, 0.3);
}

/* 去掉输入框的边框 */
.form-grid-word-theme .el-input__inner,
.form-grid-word-theme .el-textarea__inner,
.form-sub-table-word-theme .el-input__inner {
    border: 0 !important;
}

/* 设置radio在grid中的边距 */
.form-grid-word-theme .form-radio,
.form-grid-word-theme .form-checkbox {
    margin-left: 12px;
}

.form-grid-word-theme .form-radio .el-radio,
.form-grid-word-theme .form-checkbox .el-checkbox {
    margin-right: 8px;
}

.form-grid-word-theme .form-radio .el-radio:last-child,
.form-grid-word-theme .form-checkbox .el-checkbox:last-child {
    margin-right: 0;
}

/* 子表的 Word 风格主题 */
.form-sub-table-word-theme .el-table {
    border: 1px solid #000;
}

.form-sub-table-word-theme thead th,
.form-sub-table-word-theme tbody td {
    border-bottom: 1px solid #000 !important;
    border-right: 1px solid #000 !important;
}

.form-sub-table-word-theme thead th:last-child,
.form-sub-table-word-theme tbody td:last-child,
.form-sub-table-word-theme thead th:nth-last-child(2) {
    border-right: 0 !important;
}

.form-sub-table-word-theme thead th {
    text-align: center;
}

.form-sub-table-word-theme tbody td {
    background-color: #fff !important;
}

.form-sub-table-word-theme .el-table__body,
.form-sub-table-word-theme .el-table__footer,
.form-sub-table-word-theme .el-table__header {
    table-layout: unset;
}